import request from '/@/utils/request';
// 获取列表
export const getWorkOrderListApi = (params: any) => {
	return request<ResponseNameSpace.workOrder.WorkOrderResponse>({
		url: '/admin/workOrder/page',
		method: 'get',
		params,
	});
};
// 获取统计信息
export const getWorkOrderStatsApi = (params: any) => {
	return request({
		url: '/admin/workOrder/stat',
		method: 'get',
		params,
	});
};
// 获取项目点位列表
export const getPointList1Api = () => {
	return request({
		url: '/admin/projectInfo/listAll',
		method: 'get',
	});
};
// 获取末端点位列表
export const getPointList2Api = () => {
	return request({
		url: '/admin/terminalPoint/listAll',
		method: 'get',
	});
};
// 获取疑似点位列表
export const getPointList3Api = () => {
	return request({
		url: '/admin/suspectedPoint/listAll',
		method: 'get',
	});
};
// 新增工单
export const addWorkOrderApi = (data: any) => {
	return request({
		url: '/admin/workOrder/add',
		method: 'post',
		data,
	});
};
// 编辑工单
export const editWorkOrderApi = (data: any) => {
	return request({
		url: '/admin/workOrder/edit',
		method: 'post',
		data,
	});
};
// 获取工单详情
export const geWorkOrderDetailsApi = (params: { id: string }) => {
	return request({
		url: '/admin/workOrder/detail',
		method: 'get',
		params,
	});
};
// 终止工单
export const stopWorkOrderApi = (params: { id: string; stopDesc: string }) => {
	return request({
		url: '/admin/workOrder/stop',
		method: 'get',
		params,
	});
};
// 获取接收人员列表
export const getAcceptPeopleListApi = () => {
	return request({
		url: '/admin/user/listAll',
		method: 'get',
	});
};
// 分派工单
export const assignWorkOrderApi = (data: any) => {
	return request({
		url: '/admin/workOrder/assign',
		method: 'post',
		data,
	});
};
// 完成工单
export const finishWorkOrderApi = (data: any) => {
	return request({
		url: '/admin/workOrder/report',
		method: 'post',
		data,
	});
};
